A dynamic binary translator is a real time compiler that translates a source binary code complying with the architecture of a source processor (“source architecture”) into a target binary code complying with the architecture of a target processor (“target architecture”). The translation process takes place during execution of the source binary code. In order to improve execution speed of the source binary code, the dynamic binary translator may need to reduce overhead during the translation process. Overhead may include, for example, repetitive translation of a same fragment or same set of instructions of the source binary code, redundancy in saving a same set of instructions or same fragment of the source binary code being translated, etc.
Reusing translated target binary code, commonly referred to as “translation reuse”, may be an effective way to reduce the overhead incurred by the dynamic binary translator. For example, if the source binary code is unchanged during execution, the relating translated target binary code may be reused. Translation reuse may require verifying consistency of the source instruction to be currently translated compared to previously translated source instruction relating to the target binary code to be reused. To ensure consistency, a no-fault verification method may require saving all the fragments of the source binary code that affect the translation, and comparing all the saved fragments with a fragment to be executed. Unfortunately, “blindly” saving and comparing all the fragments of the source binary code may be highly space and time consuming, and even impossible. In addition, because a dynamic binary translator may not be able to discover the exact boundaries of functions of the source binary code, a conventional dynamic binary translator may need to rely on an inaccurate verification procedure to verify consistency of the source binary code, leaving certain functional issues unresolved.
It will be appreciated that for simplicity and clarity of illustration, elements shown in the figures have not necessarily been drawn to scale. For example, the dimensions of some of the elements may be exaggerated relative to other elements for clarity.